package com.zyl.demo.controller;

import com.zyl.demo.beans.BaseBean;
import com.zyl.demo.beans.Commodity;
import com.zyl.demo.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommodityController {
    @Autowired
    CommodityService commodityService;
    @PostMapping("/getCommodityById")
    public BaseBean getCommodityById(int commodityId){
        Commodity commodity = commodityService.getCommodityById(commodityId);
        return new BaseBean(commodity);
    }
}
